////////////////////////////////////////////////////////////////////////////////
// Filename: L_spriterenderer.h
////////////////////////////////////////////////////////////////////////////////
#ifndef _L_SPRITERENDERER_H_
#define _L_SPRITERENDERER_H_

#include "L_sprite.h"
#include "L_dx11vertexbuffer.h"
#include "L_dx11resourcemanager.h"

struct SpriteVertex
{
   SpriteVertex(){}
   SpriteVertex(float x, float y, float z, float u, float v)
      : pos(x,y,z), texCoord(u, v) {}

   float3 pos;
   float2 texCoord;
};

class L_SpriteRenderer
{
	ID3D11Device* Device;
	ID3D11DeviceContext* DeviceContext;
	L_DX11VertexBuffer* VertexBuffer;
	L_DX11ResourceManager* ResourceManager;

public:
	L_SpriteRenderer();
	~L_SpriteRenderer();

	bool Init(ID3D11Device* tDevice, ID3D11DeviceContext* tDeviceContext, L_DX11ResourceManager* tResourceManager);

	void BeginDraw();
	void EndDraw();

	void DrawSprite(L_Sprite Sprite);
	void DrawSprites(L_Sprite* Sprites, unsigned int NumSprites);
	void DrawSpriteList(L_Sprite* Sprites, unsigned int NumSprites, unsigned int Offset);

};

#endif;